﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Survey.master" AutoEventWireup="false" CodeFile="SurveyDetails.aspx.vb" Inherits="SurveyDetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <fieldset>
<legend><label>Survey</label></legend>
    <asp:DetailsView ID="DSurvey" runat="server" Height="50px" Width="406px" 
        DataSourceID="DSSurveyDetails" AutoGenerateRows="False" DataKeyNames="ID">
        <Fields>
            <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
            <asp:BoundField DataField="Question" HeaderText="Question" 
                SortExpression="Question" />
        </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="DSSurveyDetails" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        
        SelectCommand="SELECT [Title], [ID], [Question] FROM [tblSurvey] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="ID" Name="ID" QueryStringField="ID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
</fieldset>

<fieldset>
<legend><label>Vote</label></legend>
    <asp:RadioButtonList ID="RBLSurvey" runat="server" RepeatDirection="Horizontal">
        <asp:ListItem>Yes</asp:ListItem>
        <asp:ListItem>No</asp:ListItem>
    </asp:RadioButtonList>
    <asp:Button ID="btnVote" runat="server" Text="Vote" />
</fieldset>
<br />
    <asp:Chart ID="Chart1" runat="server" DataSourceID="DSSurvey">
        <Series>
            <asp:Series Name="Series1" XValueMember="Vote" YValueMembers="CountOfVote">
            </asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>
    <asp:SqlDataSource ID="DSSurvey" runat="server" 
    ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
    ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
    SelectCommand="SELECT [SurveyID], [Title], [CountOfVote], [Vote] FROM [QSiteCategoryResults] WHERE ([SurveyID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="SurveyID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
</asp:SqlDataSource>
</asp:Content>

